<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
<head>
<title>Group by clause</title>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <meta name="generator" content="Doc-O-Matic" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <link rel="STYLESHEET" href="default.css" type="text/css" />

<script type="text/javascript" src="scripts.js"></script>
</head>
<body class="Element700" onload="onBodyLoadEx('frames.html', 'topic', 'Group_by_clause.html');" onmousedown="onBodyMouseDown();">

<!-- Begin Popups -->

<!-- End Popups -->

<!-- Begin Page Header -->
<div class="Element710" id="areafixed">
<div class="Element94">
<em>You are here:</em> Using General SQL Parser &gt; <a href="Select_Statement.html" target="topic">Select Statement</a> &gt; <a href="Group_by_clause.html" target="topic">Group by clause</a></div>
<div class="Element92">
<table width="100%" cellspacing="0" cellpadding="0">
<tr><td width="50%">
<div class="Element2">
<a href="contents.html" target="tocidx"><img src="btn_globals_contents_midblue.gif" border="0" alt="Contents" title="Contents" onmouseover="switchImage(this, 'btn_globals_contents_midblue_hover.gif');" onmouseout="switchImage(this, 'btn_globals_contents_midblue.gif');"></a><a href="idx.html" target="tocidx"><img src="btn_globals_index_midblue.gif" border="0" alt="Index" title="Index" onmouseover="switchImage(this, 'btn_globals_index_midblue_hover.gif');" onmouseout="switchImage(this, 'btn_globals_index_midblue.gif');"></a><a href="index.html" target="topic"><img src="btn_globals_home_midblue.gif" border="0" alt="Home" title="Home" onmouseover="switchImage(this, 'btn_globals_home_midblue_hover.gif');" onmouseout="switchImage(this, 'btn_globals_home_midblue.gif');"></a></div>
</td><td width="50%">
<div class="Element90">
<a href="Where_clause.html" target="topic"><img src="btn_prev_midblue.gif" border="0" alt="Previous" title="Previous" onmouseover="switchImage(this, 'btn_prev_midblue_hover.gif');" onmouseout="switchImage(this, 'btn_prev_midblue.gif');"></a><a href="Select_Statement.html" target="topic"><img src="btn_up_midblue.gif" border="0" alt="Up" title="Up" onmouseover="switchImage(this, 'btn_up_midblue_hover.gif');" onmouseout="switchImage(this, 'btn_up_midblue.gif');"></a><a href="Having_clause.html" target="topic"><img src="btn_next_midblue.gif" border="0" alt="Next" title="Next" onmouseover="switchImage(this, 'btn_next_midblue_hover.gif');" onmouseout="switchImage(this, 'btn_next_midblue.gif');"></a></div>
</td></tr></table><div class="Element5">
Group by clause</div>
</div>
</div>

<!-- End Page Header -->

<!-- Begin Client Area -->
<div class="Element720" id="areascroll">
<div class="Element721">

<!-- Begin Page Content -->
<div class="Element58">
<a name="Description"></a><div class="Element11">
<div class="Element10">
<p class="Element10">
Group by clause in select statement was represented by 2 properties:&nbsp;</p>
<p class="Element10">

<ol class="Element633">
<li value="1" class="Element603">GroupbyClauseText,this is the string representation, you can fetch or set group by clause directly by using this property.</li>
</ol>&nbsp;</p>
<p class="Element10">
Text in GroupbyClauseText includes group by keyword, so if you fetch value from GroupbyClauseText, you can see something like this: group by f1,f2, but not value like this: f1,f2.&nbsp;</p>
<p class="Element10">
If you want to append new field value, then do something like this:&nbsp;</p>
<p class="Element10">
GroupbyClauseText = GroupbyClauseText + &quot;,f3&quot;&nbsp;</p>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
Or set new value of GroupbyClauseText,&nbsp;</p>
<p class="Element10">
GroupbyClauseText = &quot;group by f3&quot;;&nbsp;</p>
<p class="Element10">

<ol class="Element633">
<li value="2" class="Element603">GroupbyClause, which is type of TLzGroupBy,and represents detailed information about group by clause.</li>
</ol>&nbsp;</p>
<p class="Element10">
You can also modify GroupbyClauseText via modifying GroupbyClause. By using GroupbyClause, you can take full control of every field involved in Group by Clause.&nbsp;</p>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
The key property of TLzGroupBy is GroupItems which is type of TLz_list. And items in GroupItems is type of TLzGroupByItem, so you can always cast items in GroupItems to TLzGroupByItem.&nbsp;</p>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
The key property of TLzGroupByItem is _ndExpr which can always been cast to <a href="TLzCustomExpression.html" target="topic">TLzCustomExpression</a>, usually, _ndExpr represents field in the group by clause.&nbsp;</p>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
Check BuildSelect function in this demo to find out more information:&nbsp;</p>
<p class="Element10">
<a href="http://www.sqlparser.com/dl/samples/buildsql.zip">http://www.sqlparser.com/dl/samples/buildsql.zip</a>&nbsp;</p></div>
</div>
</div>
<!-- End Page Content -->

<!-- Begin Page Footer -->
<div class="Element93">
<table width="100%" cellspacing="0" cellpadding="0">
<tr><td width="100%">
<div class="Element3">
Gudu software http://www.sqlparser.com</div>
</td></tr><tr><td width="100%">
<div class="Element97">
Send <a href="#" onclick="sendFeedback('info@sqlparser.com', 'Documentation Feedback', 'Project: General SQL Parser Help file%0ATopic ID: Group by clause%0ATitle: Group by clause');">comments</a> about this topic.</div>
</td></tr></table></div>

<!-- End Page Footer -->
</div>
</div>

<!-- End Client Area -->
</body></html>